package com.sudingke.waimai;

 

import org.json.JSONObject;

import com.sudingke.util.HttpRequest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class TestActivity extends Activity {
    
    private Button btnHome;
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
	Button btnHome = (Button) findViewById(R.id.button1);
	btnHome.setOnClickListener(new View.OnClickListener() {
	    @Override
	    public void onClick(View v) {
		
		String url = "http://m.sudingke.com/zirui.php";
		HttpRequest httpRequest = new HttpRequest(url, null);

		JSONObject jo = httpRequest.getResponsJSON();
		//String jo = httpRequest.getResponsString();
		Toast.makeText(TestActivity.this, jo.toString(), Toast.LENGTH_LONG).show();
	    }
	});  
    }
}